class Animal:
    def __init__(self, name):
        self.name = name

    def eat(self):
        print("吃---")

    def drink(self):
        print("喝---")

    def run(self):
        print("跑---")

    def sleep(self):
        print("睡---")

class Dog(Animal):
    def __init__(self, name, color):
        super().__init__(name)# 有自己的属性或者方法与父类相同的直接覆盖
        self.color = color
    def run(self):
        super(Dog, self).run()
        print(f'{self.name}跑得快')

    def bark(self):
        print(f'{self.name}汪汪汪叫{self.color}')

class XiaoTianQuan(Dog):
    def __init__(self, name, color, age):
        super(XiaoTianQuan, self).__init__(name, color)
        self.age = age

    def fly(self):
        print(f'{self.name}飞天--{self.color}--{self.age}')


if __name__ == '__main__':
    wangcai = Dog("旺财", '黄色')
    wangcai.run()
    wangcai.sleep()
    wangcai.bark()
    xiaotianquan = XiaoTianQuan("夏松填权", '黑色', 13)
    xiaotianquan.fly()
